home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / Technical.Notes / PDOS / TN.PDOS.012 < prev    next >
Encoding:
Text File  |  1988-12-15  |  2.6 KB  |  57 lines  |  [TEXT/pdos]

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6.  
  7. ProDOS 8
  8. #12:    Interrupt Handling
  9.  
  10. Revised by:    Matt Deatherage                                  November 1988
  11. Revised by:    Pete McDonald                                    November 1985
  12.  
  13. This Technical Note clarifies some aspects of ProDOS 8 interrupt handlers.
  14. _____________________________________________________________________________
  15.  
  16. Although the ProDOS 8 Technical Reference Manual (section 6.2) documents 
  17. interrupt handlers and includes a code example, there still remain a few 
  18. unclear areas on this subject matter; this Note clarifies these areas.
  19.  
  20. All interrupt routines must begin with a CLD instruction.  Although not 
  21. checked in initial releases of ProDOS 8, this first byte will be checked in 
  22. future revisions to verify the validity of the interrupt handler.
  23.  
  24. Although your interrupt handler does not have to disable interrupts (ProDOS 8 
  25. does that for you), it must never re-enable interrupts with a 6502 CLI 
  26. instruction.  Another interrupt coming through during a non-reentrant 
  27. interrupt handler can bring the system down.
  28.  
  29. If your application includes an interrupt handler, you should do the following 
  30. before exiting:
  31.  
  32. 1.    Turn off the interrupt source.  Remember, 255 unclaimed interrupts 
  33.       will cause system death.
  34. 2.    Make a DEALLOC_INTERRUPT call before exiting from your 
  35.       application.  Do not leave a vector installed that points to a 
  36.       routine that is no longer there.
  37.  
  38. Within your interrupt handler routines, you must leave all memory banks in the 
  39. same configuration you found them.  Do not forget anything:  main language 
  40. card, main alternate $D000 space, main motherboard ROM, and, on an Apple IIe, 
  41. IIc, or IIGS, auxiliary language card, auxiliary alternate $D000 space, 
  42. alternate zero page and stack, etc.  This is very important since the ProDOS 
  43. interrupt receiver assumes that the environment is absolutely unaltered when 
  44. your handler relinquishes control.  In addition, be sure to leave the language 
  45. card write-enabled.
  46.  
  47. If your handler recognizes an interrupt and services it, you should clear the 
  48. carry flag (CLC) immediately before returning (RTS).  If it was not your 
  49. interrupt, you set set the carry (SEC) immediately before returning (RTS).  Do 
  50. not use a return from interrupt (RTI) to exit; the ProDOS interrupt receiver 
  51. still has some housekeeping to perform before it issues the RTI instruction.
  52.  
  53.  
  54. Further Reference
  55. o    ProDOS 8 Technical Reference Manual
  56.  
  57.